var page = 1;
var table = "cjsctjtemp";
var firstPage = false;
var lastPage = false;
var totalPage = 0;
var flag = true;
$(document).ready(function() {
	$('input:checkbox').each(function() {
		$(this).attr('checked', true);
	});
	$("#btn1").css("display", "none");
	$("#btn2").css("display", "none");
});
$(function() {
	// 获取行政区数据
	$.ajax({
		url : 'dynamic/tree/tree',
		dataType : 'json'
	}).done(function(data) {
		if (!data) {
			return;
		}

		// 初始化行政区树
		var settings = {
			treeId : "mytree",
			check : {
				enable : true,
			},
			view : {
				showIcon : false,
				fontCss : {
					font_size : "13px"
				}
			},
			callback : {
				onClick : myOnClick,
				onCheck : myOnCheck
			}
		};
		var treeObj = $.fn.zTree.init($('#xzqtree'), settings, data);
		// var nodes = treeObj.getNodesByParam("name", "root", null);
		// var treeId=treeObj.
		treeObj.checkAllNodes(true);
		var nodes = treeObj.getNodes();
		if (nodes.length > 0) {
			treeObj.expandNode(nodes[0], true, false, true);
		}
		var nodes2 = treeObj.getNodesByParam("parentId", "-1", null);

		if (nodes2.length == 2) {
			treeObj.expandNode(nodes2[0], true, false, true);
			treeObj.expandNode(nodes2[1], true, false, true);
		}
		var nodes2 = treeObj.getNodesByParam("name", "谭坪外围", null);
		if (nodes2.length == 1) {
			treeObj.expandNode(nodes2[0], true, false, true);
		}

		// 节点点击的处理
		function myOnClick(event, treeId, treeNode) {
			// alert(treeNode.tId + ", " + treeNode.name);
			var j_name = treeNode.name;
			// alert("hhh");
			testajax(j_name);
			// alert("hhe");
		}
		// 节点checked的处理
		function myOnCheck(event, treeId, treeNode) {
			// alert(treeNode.tId + ", " + treeNode.name + "," +
			// treeNode.checked);
			// alert(treeId);
			redirect();
			/*
			 * if (treeNode.checked) { // alert("123"); redirect(); }
			 */
		}
	});
});

var testajax = function test(j_name) {
	// alert("ajax请求！" + j_name);
	$.ajax({
		url : 'basic/query?id=' + encodeURI(encodeURI(j_name)),
		dataType : 'json'
	}).done(function(data1) {
		if (!data1) {
			return;
		}
		// var json=JSON.stringify(data1);
		var obj = JSON.parse(data1);
		// alert(obj.wellname);
		var str1 = "<tr bgcolor='#FFEC8B'>";
		str1 += "<th class='tab_title tabel_hei'>井名</th>";
		str1 += "<th class='tab_title tabel_hei'>生产层位</th>";
		str1 += "<th class='tab_title tabel_hei'>投产日期</th>";
		str1 += "<th class='tab_title tabel_hei'>见气日期</th>";
		str1 += "<th class='tab_title tabel_hei'>见气周期</th>";
		str1 += "<th class='tab_title tabel_hei'>见气前累产液</th>";
		str1 += "<th class='tab_title tabel_hei'>见气前返排率</th>";
		str1 += "<th class='tab_title tabel_hei'>起抽压力</th>";
		str1 += "<th class='tab_title tabel_hei'>解吸压力</th>";
		str1 += "<th class='tab_title tabel_hei'>总液量</th>";
		str1 += "<th class='tab_title tabel_hei'>总砂量</th>";
		str1 += "<th class='tab_title tabel_hei'>破裂压力</th>";
		str1 += "<th class='tab_title tabel_hei'>停泵压力</th>";
		str1 += "</tr>";
		var str = "<tr>";
		str += "<td class='tab_title tabel_hei'>" + obj.wellname + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.CW + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.TCRQ + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.JQRQ + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.JQZQ + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.JQQLCY + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.JQQFPY + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.QCYL + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.JXYL + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.ZYL + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.ZSL + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.PLYL + "</td>";
		str += "<td class='tab_title tabel_hei'>" + obj.TBYL + "</td>";
		str += "</tr>";
		$('#table1').html(str1 + str);
	});
}

function check_all() {
	var count = 0
	var allzdbs = document.getElementsByName("ziduan");
	for ( var i = 0; i < allzdbs.length; i++) {
		count++;
		if (allzdbs[i].checked == true) {

			for ( var j = 0; i < allzdbs.length; j++) {
				allzdbs[j].checked = false;
			}
		} else if (count == allzdbs.length) {
			for ( var j = 0; i < allzdbs.length; j++) {
				allzdbs[j].checked = true;
			}
		}
	}
}
function redirect() {
	var x = document.getElementById('s1');
	var b = x.options[x.selectedIndex].value;
	var text = x.options[x.selectedIndex].text;
	// alert("page"+page);
	// alert(b);
	var treeObj = $.fn.zTree.getZTreeObj("xzqtree");
	nodes = treeObj.getCheckedNodes(true);
	// var arr = new Array(nodes.name);
	// var idstr=arr.join(',');//将数组元素连接起来以构建一个字符串
	var str = "";
	for ( var i = 0; i < nodes.length; i++) {
		if (nodes[i].name == nodes[i].id && (!nodes[i].isParent)) {
			// alert(nodes[i].name+"="+nodes[i].id);
			str += nodes[i].name;
			if (i < nodes.length - 1) {
				str = str + ",";
			}
		}
		//
	}
	$.ajax({
		/*
		 * url : 'basic/treeTable?wellname1=' + encodeURI(encodeURI(str)) +
		 * '&table=' + b,
		 */
		type : 'post',
		url : 'basic/treeTable',
		// data:'wellname1=' + encodeURI(encodeURI(str))+ '&table=' + b,
		data : 'wellname1=' + str + '&table=' + b + '&page=1',
		dataType : 'json'
	}).done(function(data1) {
		if (!data1) {
			return;
		}
		// alert(b);
		// alert(data1);
		// var json=JSON.stringify(data1);
		// var obj = JSON.parse(data1);
		if (text == "请选择") {
			b = "cjsctjtemp";
			// alert("123");
			text = "实测统计表";
		}
		flag = true;
		var str = protable(b, data1.list, text);
		$('#table1').html(str);
		$('#lblToatl').text(data1.totalRow);
		$('#lblCurent').text(data1.pageNumber);
		$('#lblPageCount').text(data1.totalPage);
		firstPage = data1.firstPage;
		lastPage = data1.lastPage;
		totalPage = data1.totalPage;
		// alert(data.firstPage);
		// alert("123");
		// alert(JSON.stringify(data1));
		// $('#paginate').css("display","none");
	});

}

function redirec() {
	var x = document.getElementById('s1')
	var b = x.options[x.selectedIndex].value;
	var text = x.options[x.selectedIndex].text;
	// alert(text);
	if (text == "请选择") {
		b = "cjsctjtemp";
		// alert("123");
		text = "实测统计表";
	}
	// alert("page"+page);
	// alert(b);
	var treeObj = $.fn.zTree.getZTreeObj("xzqtree");
	nodes = treeObj.getCheckedNodes(true);
	// var arr = new Array(nodes.name);
	// var idstr=arr.join(',');//将数组元素连接起来以构建一个字符串
	var str = "";
	for ( var i = 0; i < nodes.length; i++) {
		if (nodes[i].name == nodes[i].id && (!nodes[i].isParent)) {
			// alert(nodes[i].name+"="+nodes[i].id);
			str += nodes[i].name;
			if (i < nodes.length - 1) {
				str = str + ",";
			}
		}
		//
	}
	$.ajax({
		/*
		 * url : 'basic/treeTable?wellname1=' + encodeURI(encodeURI(str)) +
		 * '&table=' + b,
		 */
		type : 'post',
		url : 'basic/treeTable',
		// data:'wellname1=' + encodeURI(encodeURI(str))+ '&table=' + b,
		data : 'wellname1=' + str + '&table=' + b + '&page=' + page,
		dataType : 'json'
	}).done(function(data1) {
		if (!data1) {
			return;
		}

		// alert(b);
		// alert(data1);
		// var json=JSON.stringify(data1);
		// var obj = JSON.parse(data1);
		var str = protable(b, data1.list, text);
		$('#table1').html(str);
		checktable();
		$('#lblToatl').text(data1.totalRow);
		$('#lblCurent').text(data1.pageNumber);
		$('#lblPageCount').text(data1.totalPage);
		firstPage = data1.firstPage;
		lastPage = data1.lastPage;
		totalPage = data1.totalPage;
		// alert(data.firstPage);
		// alert("123");
		// alert(JSON.stringify(data1));
		// $('#paginate').css("display","none");
	});

}

$("#first").click(function() {
	if (!firstPage) {
		page = 1;
		redirec();
	}
});
$("#previous").click(function() {
	// alert(page);
	// alert(firstPage);
	if (!firstPage) {
		page = parseInt($('#lblCurent').text()) - 1;
		redirec();
	}
});
$("#next").click(function() {
	// alert("下一页");
	// alert(lastPage);
	if (!lastPage) {
		page = parseInt($('#lblCurent').text()) + 1;
		redirec();
	}
});
$("#last").click(function() {
	// alert("3");
	// alert(firstPage);
	if (!lastPage) {
		page = totalPage;
		redirec();
	}
});

function colunms() {
	// alert("hello");
	var str = "";
	if (flag) {
		$("#table1 tr")
				.each(
						function() {
							var tdArr = $(this).children("th");
							for ( var i = 1; i < tdArr.length; i++) {
								str += "<input type='checkbox' class='cb_left' name='ziduan'  value="
										+ i + ">" + tdArr.eq(i).text() + "<br>"
							}
						});
		// alert(str);
		$("#condition1").html(str);
		flag = false;
	}
}
function checktable() {
	/*
	 * var id_array = new Array();
	 * $('input[name="ziduan"]:checked').each(function() {
	 * id_array.push($(this).val());// 向数组中添加元素 }); var idstr =
	 * id_array.join(',');// 将数组元素连接起来以构建一个字符串 alert(idstr);
	 */
	// alert($("#table1 tr").children("th:eq(0)").text());
	var arr = new Array();
	var i = 0;
	$("input[name='ziduan']").not("input:checked").each(function() {
		arr[i++] = $(this).val();
	});
	var ar = new Array();
	var i = 0;
	$('input[name="ziduan"]:checked').each(function() {
		ar[i++] = $(this).val();
	});
	/*
	 * for ( var int = 0; int < ar.length; int++) { alert("hah"+ar[int]); }
	 */
	// alert(arr);
	for ( var j = 0; j < arr.length; j++) {
		for ( var index = 0; index < 100; index++) {
			if (arr[j] == index) {
				// alert(index);
				// alert("nocheck" + arr[j]);
				// var b=parseInt(arr[j]);
				var s = "t" + arr[j];
				// alert(s);
				// alert(document.getElementsByName(s));
				var t = document.getElementsByName(s);
				// alert(t[0]);
				for ( var k = 0; k < t.length; k++) {
					t[k].style.display = "none";
				}

				// document.getElementsByName(s).setAttribute("style","background-color:white");
				// tdArr.eq(index).css("display", "none");
				break;
			}
		}
	}
	for ( var j = 0; j < ar.length; j++) {
		for ( var index = 0; index < 100; index++) {
			if (ar[j] == index) {
				// alert(index);
				// alert("nocheck" + ar[j]);
				// var b=parseInt(arr[j]);
				var s = "t" + ar[j];
				// alert(s);
				// alert(document.getElementsByName(s));
				var t = document.getElementsByName(s);
				// alert(t[0]);
				for ( var k = 0; k < t.length; k++) {
					t[k].style.display = "table-cell";
				}

				// document.getElementsByName(s).setAttribute("style","background-color:white");
				// tdArr.eq(index).css("display", "none");
				break;
			}
		}
	}
	/*
	 * $("#table1 tr").each(function() { var index = 0; var tdArr =
	 * $(this).children(); for ( var j = 0; j < arr.length; j++) { for ( var
	 * index = 0; index < 1000; index++) { var b=j+1; var s="#t"+b; if (arr[j] ==
	 * index) { // alert(index); alert($(s).text()); $(s).css("display",
	 * "none"); //tdArr.eq(index).css("display", "none"); break; }else{
	 * $(s).css("display", "block"); } } } });
	 */
	// window.location.reload();
	// alert("123");
	$("#loginmodal").css("display", "none");
	$("#lean_overlay").css("display", "none");
	// $.fancybox.close();
	// $('#modaltrigger').leanModal({ top: 110, overlay: 0.45, closeButton:
	// ".modal_close" });
}

// 根据选择的井号生成表格
function protable(table, data1, text) {
	var str1 = "";
	if (table == "cjkj") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th  name='t0' class='tab_title tabel_hei'><input type='checkbox' name='record1' checked='checked' onclick='quanxuan()'/>全选</th>";
		str1 += "<th  name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th  name='t2' class='tab_title tabel_hei'>所属井组</th>";
		str1 += "<th  name='t3' class='tab_title tabel_hei'>所属区块</th>";
		str1 += "<th  name='t4' class='tab_title tabel_hei'>所属气田</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></th>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>"
					+ obj.wellgroupcode + "</td>";
			str1 += "<td  name='t3' class='tab_title tabel_hei'>"
					+ obj.blockcode + "</td>";
			str1 += "<td  name='t4' class='tab_title tabel_hei'>"
					+ obj.gasfieldcode + "</td>";
			str1 += "</tr>";
		}
		// alert(str1);
	} else if (table == "cjjbxx") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' name='record1' checked='checked' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>经度</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>纬度</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>标高</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>埋深</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>总厚度</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>净厚度</th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>夹矸厚度</th>";
		str1 += "<th name='t9' class='tab_title tabel_hei'>夹矸层数</th>";
		str1 += "<th name='t10' class='tab_title tabel_hei'>顶板厚度</th>";
		str1 += "<th name='t11' class='tab_title tabel_hei'>底板厚度</th>";
		str1 += "<th name='t12' class='tab_title tabel_hei'>储层压力</th>";
		str1 += "<th name='t13' class='tab_title tabel_hei'>压力梯度</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td  name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>"
					+ obj.longitude + "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.latitude
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>"
					+ obj.elevation + "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.depth
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>"
					+ obj.totalthickness + "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>"
					+ obj.netthickness + "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>"
					+ obj.tonsteinthickness + "</td>";
			str1 += "<td name='t9' class='tab_title tabel_hei'>"
					+ obj.tonsteinnum + "</td>";
			str1 += "<td name='t10' class='tab_title tabel_hei'>"
					+ obj.roofthickness + "</td>";
			str1 += "<td name='t11' class='tab_title tabel_hei'>"
					+ obj.floorthinkness + "</td>";
			str1 += "<td name='t12' class='tab_title tabel_hei'>"
					+ obj.stratumpressure + "</td>";
			str1 += "<td name='t13'class='tab_title tabel_hei'>"
					+ obj.pressuregradient + "</td>";
			str1 += "</tr>";
		}
	} else if (table == "cjmcxx") {
		// alert("cjmcxx");
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' name='record1'checked='checked' onclick='quanxuan()'/>全选</th>";
		str1 += "<th  name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>煤层岩性编码</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>分层号</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>靶点X坐标</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>靶点Y坐标	</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>顶海拔深</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>顶测深</th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>底测深</th>";
		str1 += "<th name='t9' class='tab_title tabel_hei'>视厚	</th>";
		str1 += "<th name='t10' class='tab_title tabel_hei'>顶垂深</th>";
		str1 += "<th name='t11' class='tab_title tabel_hei'>底垂深</th>";
		str1 += "<th name='t12' class='tab_title tabel_hei'>垂厚	</th>";
		str1 += "<th name='t13' class='tab_title tabel_hei'>井径	</th>";
		str1 += "<th name='t14' class='tab_title tabel_hei'>自然电位</th>";
		str1 += "<th name='t15' class='tab_title tabel_hei'>自然伽马</th>";
		str1 += "<th name='t16' class='tab_title tabel_hei'>深侧向电阻	</th>";
		str1 += "<th name='t17' class='tab_title tabel_hei'>浅侧向电阻	</th>";
		str1 += "<th name='t18' class='tab_title tabel_hei'>微球形聚焦</th>";
		str1 += "<th name='t19' class='tab_title tabel_hei'>中子	</th>";
		str1 += "<th name='t20' class='tab_title tabel_hei'>声波时差</th>";
		str1 += "<th name='t21' class='tab_title tabel_hei'>密度	</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td  name='t1'class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td  name='t2' class='tab_title tabel_hei'>"
					+ obj.Lithologycode + "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.layered
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>"
					+ obj.longitude + "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.latitude
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.TELD
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>" + obj.TS
					+ "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>" + obj.ES
					+ "</td>";
			str1 += "<td name='t9' class='tab_title tabel_hei'>" + obj.DOT
					+ "</td>";
			str1 += "<td name='t10' class='tab_title tabel_hei'>" + obj.TDD
					+ "</td>";
			str1 += "<td name='t11'class='tab_title tabel_hei'>" + obj.BVD
					+ "</td>";
			str1 += "<td name='t12' class='tab_title tabel_hei'>" + obj.TVT
					+ "</td>";
			str1 += "<td name='t13' class='tab_title tabel_hei'>" + obj.CAL
					+ "</td>";

			str1 += "<td name='t14' class='tab_title tabel_hei'>" + obj.SP
					+ "</td>";
			str1 += "<td name='t15' class='tab_title tabel_hei'>" + obj.GR
					+ "</td>";
			str1 += "<td name='t16' class='tab_title tabel_hei'>" + obj.RD
					+ "</td>";
			str1 += "<td name='t17'class='tab_title tabel_hei'>" + obj.RS
					+ "</td>";
			str1 += "<td name='t18' class='tab_title tabel_hei'>" + obj.RXO
					+ "</td>";
			str1 += "<td name='t19' class='tab_title tabel_hei'>" + obj.CNL
					+ "</td>";
			str1 += "<td name='t20' class='tab_title tabel_hei'>" + obj.AC
					+ "</td>";
			str1 += "<td name='t21' class='tab_title tabel_hei'>" + obj.DEN
					+ "</td>";
			str1 += "</tr>";
		}
	} else if (table == "cjsjxx") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0'  class='tab_title tabel_hei'><input type='checkbox' name='record1' checked='checked' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1'  class='tab_title tabel_hei'>井名</th>";
		str1 += "<th  name='t2' class='tab_title tabel_hei'>煤层编号</th>";
		str1 += "<th name='t3'  class='tab_title tabel_hei'>测试井段</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>储层压力</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>压力梯度</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>储层温度</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>渗透率</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>" + obj.NCS
					+ "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.interval
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.pressure
					+ "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.PCPG
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>"
					+ obj.temperature + "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>"
					+ obj.penetrance + "</td>";
			str1 += "</tr>";
		}

	} else if (table == "cjdwxf") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox'  checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>煤层编号</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>样品含气量	</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>储层压力</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>理论含气量	</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>兰氏体积</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>兰氏压力</th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>含气饱和度	</th>";
		str1 += "<th name='t9' class='tab_title tabel_hei'>临界解吸压力</th>";
		str1 += "<th name='t10' class='tab_title tabel_hei'>临界解吸压力</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox'checked='checked'  name='record'/></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>" + obj.NCS
					+ "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.ACS
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.pressure
					+ "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.TGC
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.Volume
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>"
					+ obj.pressurelan + "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>"
					+ obj.saturability + "</td>";
			str1 += "<td name='t9' class='tab_title tabel_hei'>" + obj.CDP
					+ "</td>";
			str1 += "<td name='t10' class='tab_title tabel_hei'>" + obj.CDP
					+ "</td>";
			str1 += "</tr>";
		}
	} else if (table == "cjzfxx") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>灰分	</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>镜质组分</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>惰质组分</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>壳质组分</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>镜惰比</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>镜质体反射率</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>" + obj.ASH
					+ "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>"
					+ obj.Vitrinite + "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>"
					+ obj.Inertinite + "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.Exinite
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.MIR
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>" + obj.VR
					+ "</td>";
			str1 += "</tr>";
		}

	} else if (table == "cjscjt") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' name='record1'checked='checked' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>生产层位</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>投产日期</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>见气日期</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>见气周期</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>见气前累产液</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>见气前返排率</th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>起抽压力</th>";
		str1 += "<th name='t9' class='tab_title tabel_hei'>解吸压力</th>";
		str1 += "<th name='t10' class='tab_title tabel_hei'>总液量</th>";
		str1 += "<th name='t11' class='tab_title tabel_hei'>总砂量</th>";
		str1 += "<th name='t12' class='tab_title tabel_hei'>破裂压力</th>";
		str1 += "<th  name='t13'class='tab_title tabel_hei'>停泵压力</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>" + obj.CW
					+ "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.TCRQ
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.JQRQ
					+ "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.JQZQ
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.JQQLCY
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>" + obj.JQQFPY
					+ "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>" + obj.QCYL
					+ "</td>";
			str1 += "<td name='t9' class='tab_title tabel_hei'>" + obj.JXYL
					+ "</td>";
			str1 += "<td name='t10' class='tab_title tabel_hei'>" + obj.ZYL
					+ "</td>";
			str1 += "<td name='t11' class='tab_title tabel_hei'>" + obj.ZSL
					+ "</td>";
			str1 += "<td name='t12' class='tab_title tabel_hei'>" + obj.PLYL
					+ "</td>";
			str1 += "<td name='t13' class='tab_title tabel_hei'>" + obj.TBYL
					+ "</td>";
			str1 += "</tr>";
		}

	} else if (table == "cjscrsctemp") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked'  name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>生产日期</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>生产时间</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>泵径/泵深	</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>冲次/冲程	</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>电流	</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>套压	</th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>动液面</th>";
		str1 += "<th name='t9' class='tab_title tabel_hei'>日降液面</th>";
		str1 += "<th name='t10' class='tab_title tabel_hei'>井底流压</th>";
		str1 += "<th name='t11' class='tab_title tabel_hei'>日降井底流压</th>";
		str1 += "<th name='t12' class='tab_title tabel_hei'>煤粉情况</th>";
		str1 += "<th name='t13' class='tab_title tabel_hei'>泵效	</th>";
		str1 += "<th name='t14' class='tab_title tabel_hei'>日产气</th>";
		str1 += "<th name='t15' class='tab_title tabel_hei'>日产液</th>";
		str1 += "<th name='t16' class='tab_title tabel_hei'>氯根	</th>";
		str1 += "<th name='t17' class='tab_title tabel_hei'>PH值</th>";
		str1 += "<th name='t18' class='tab_title tabel_hei'>燃气机用气	</th>";
		str1 += "<th name='t19' class='tab_title tabel_hei'>备注</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>" + obj.SCRQ
					+ "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.SCSJ
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.BJBS
					+ "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.CCCC
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.TL
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>" + obj.TY
					+ "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>" + obj.DYM
					+ "</td>";
			str1 += "<td name='t9' class='tab_title tabel_hei'>" + obj.YJYM
					+ "</td>";
			str1 += "<td name='t10' class='tab_title tabel_hei'>" + obj.PWF
					+ "</td>";
			str1 += "<td name='t11' class='tab_title tabel_hei'>" + obj.DPWF
					+ "</td>";
			str1 += "<td name='t12' class='tab_title tabel_hei'>" + obj.MFJK
					+ "</td>";
			str1 += "<td name='t13' class='tab_title tabel_hei'>" + obj.BX
					+ "</td>";
			str1 += "<td name='t14' class='tab_title tabel_hei'>" + obj.QQ
					+ "</td>";
			str1 += "<td name='t15' class='tab_title tabel_hei'>" + obj.QL
					+ "</td>";
			str1 += "<td name='t16' class='tab_title tabel_hei'>" + obj.CL
					+ "</td>";
			str1 += "<td name='t17' class='tab_title tabel_hei'>" + obj.PH
					+ "</td>";
			str1 += "<td name='t18' class='tab_title tabel_hei'>" + obj.RQYQ
					+ "</td>";
			str1 += "<td name='t19' class='tab_title tabel_hei'>" + obj.BAK
					+ "</td>";
			str1 += "</tr>";
		}

	} else if (table == "cjsctjtemp") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>生产日期</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>月累产气</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>年累产气</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>累产气量</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>月累产液</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>年累产液</th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>累产液量</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>" + obj.SCRQ
					+ "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.YLCQ
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.LLCQ
					+ "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.LJCQ
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.YLCY
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>" + obj.LLCY
					+ "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>" + obj.LJCY
					+ "</td>";
			str1 += "</tr>";
		}
	} else if (table == "cjgbyxpz") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>隔板岩性编码</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>隔板岩性名称</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>备注</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>"
					+ obj.Lithologycode + "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>"
					+ obj.Lithologyname + "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.note
					+ "</td>";
			str1 += "</tr>";
		}
	} else if (table == "cjgblxpz") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>隔板类型编码</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>隔板类型名称</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>备注</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>"
					+ obj.Lithologycode + "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>"
					+ obj.Lithologyname + "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.note
					+ "</td>";
			str1 += "</tr>";
		}

	} else if (table == "cjgbxx") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>隔板类型编码 </th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>隔板岩性编码</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>靶点X坐标 </th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>靶点Y坐标</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>顶海拔深</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>隔板顶测深 </th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>隔板底测深</th>";
		str1 += "<th name='t9' class='tab_title tabel_hei'>隔板视厚</th>";
		str1 += "<th name='t10' class='tab_title tabel_hei'>隔板顶垂深 </th>";
		str1 += "<th name='t11' class='tab_title tabel_hei'>隔板底垂深</th>";
		str1 += "<th name='t12' class='tab_title tabel_hei'>隔板垂厚</th>";
		str1 += "<th name='t13' class='tab_title tabel_hei'>隔板井径</th>";
		str1 += "<th name='t14' class='tab_title tabel_hei'>自然伽马 </th>";
		str1 += "<th name='t15' class='tab_title tabel_hei'>深侧向电阻 </th>";
		str1 += "<th name='t16' class='tab_title tabel_hei'>浅侧向电阻 </th>";
		str1 += "<th name='t17' class='tab_title tabel_hei'>微球形聚焦</th>";
		str1 += "<th name='t18' class='tab_title tabel_hei'>中子 </th>";
		str1 += "<th name='t19' class='tab_title tabel_hei'>声波时差 </th>";
		str1 += "<th name='t20' class='tab_title tabel_hei'>密度 </th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0'class='tab_title tabel_hei'><input type='checkbox'checked='checked'  name='record'/></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>"
					+ obj.Baffletcode + "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>"
					+ obj.Lithologycode + "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>"
					+ obj.longitude + "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.latitude
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.TELD
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>" + obj.TS
					+ "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>" + obj.ES
					+ "</td>";
			str1 += "<td name='t9' class='tab_title tabel_hei'>" + obj.DOT
					+ "</td>";
			str1 += "<td name='t10' class='tab_title tabel_hei'>" + obj.TDD
					+ "</td>";
			str1 += "<td name='t11' class='tab_title tabel_hei'>" + obj.BVD
					+ "</td>";
			str1 += "<td name='t12' class='tab_title tabel_hei'>" + obj.TVT
					+ "</td>";
			str1 += "<td name='t13' class='tab_title tabel_hei'>" + obj.CAL
					+ "</td>";
			str1 += "<td name='t14' class='tab_title tabel_hei'>" + obj.GR
					+ "</td>";
			str1 += "<td name='t15' class='tab_title tabel_hei'>" + obj.RD
					+ "</td>";
			str1 += "<td name='t16' class='tab_title tabel_hei'>" + obj.RS
					+ "</td>";
			str1 += "<td name='t17' class='tab_title tabel_hei'>" + obj.RXO
					+ "</td>";
			str1 += "<td name='t18' class='tab_title tabel_hei'>" + obj.CNL
					+ "</td>";
			str1 += "<td name='t19' class='tab_title tabel_hei'>" + obj.AC
					+ "</td>";
			str1 += "<td name='t20' class='tab_title tabel_hei'>" + obj.DEN
					+ "</td>";
			str1 += "</tr>";
		}
	} else if (table == "mcyxpz") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>煤层岩性编码</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>煤层岩性名称</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>备注</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>"
					+ obj.Lithologycode + "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>"
					+ obj.Lithologyname + "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.note
					+ "</td>";
			str1 += "</tr>";
		}
	} else if (table == "cjbbtjtrue") {
		// alert(text);
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>生产日期</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>月累产气</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>年累产气</th>";
		str1 += "<th name='t5' class='tab_title tabel_hei'>累产气量</th>";
		str1 += "<th name='t6' class='tab_title tabel_hei'>月累产液</th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>月累产液</th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>累产液量</th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>" + obj.SCRQ
					+ "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.YLCQ
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.LLCQ
					+ "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.LJCQ
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.YLCY
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>" + obj.LLCY
					+ "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>" + obj.LJCY
					+ "</td>";
			str1 += "</tr>";
		}
	} else if (table == "cjbbrsctrue") {
		$('#tablename').html("<div style='font-size:25px'>" + text + "</div>");
		str1 += "<tr bgcolor='#FFEC8B'>";
		str1 += "<th name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record1' onclick='quanxuan()'/>全选</th>";
		str1 += "<th name='t1' class='tab_title tabel_hei'>井名</th>";
		str1 += "<th name='t2' class='tab_title tabel_hei'>生产日期</th>";
		str1 += "<th name='t3' class='tab_title tabel_hei'>生产时间</th>";
		str1 += "<th name='t4' class='tab_title tabel_hei'>泵径/泵深  </th>";
		str1 += "<th name='t5'class='tab_title tabel_hei'>冲次/冲程  </th>";
		str1 += "<th name='t6'class='tab_title tabel_hei'>电流 </th>";
		str1 += "<th name='t7' class='tab_title tabel_hei'>套压 </th>";
		str1 += "<th name='t8' class='tab_title tabel_hei'>动液面 </th>";
		str1 += "<th name='t9' class='tab_title tabel_hei'>日降液面</th>";
		str1 += "<th name='t10' class='tab_title tabel_hei'>日降液面</th>";
		str1 += "<th name='t11' class='tab_title tabel_hei'>日降井底流压</th>";
		str1 += "<th name='t12' class='tab_title tabel_hei'>煤粉情况</th>";
		str1 += "<th name='t13' class='tab_title tabel_hei'>泵效 </th>";
		str1 += "<th name='t14' class='tab_title tabel_hei'>日产气 </th>";
		str1 += "<th name='t15' class='tab_title tabel_hei'>日产液 </th>";
		str1 += "<th name='t16' class='tab_title tabel_hei'>氯根 </th>";
		str1 += "<th name='t17' class='tab_title tabel_hei'>PH值 </th>";
		str1 += "<th name='t18' class='tab_title tabel_hei'>燃气机用气 </th>";
		str1 += "<th name='t19' class='tab_title tabel_hei'>备注 </th>";
		str1 += "</tr>";
		for ( var i = 0; i < data1.length; i++) {
			var obj = data1[i];
			str1 += "<tr>";
			str1 += "<td name='t0' class='tab_title tabel_hei'><input type='checkbox' checked='checked' name='record' value="
					+ obj.ID + "></td>";
			str1 += "<td name='t1' class='tab_title tabel_hei'>" + obj.wellname
					+ "</td>";
			str1 += "<td name='t2' class='tab_title tabel_hei'>" + obj.SCRQ
					+ "</td>";
			str1 += "<td name='t3' class='tab_title tabel_hei'>" + obj.SCSJ
					+ "</td>";
			str1 += "<td name='t4' class='tab_title tabel_hei'>" + obj.BJBS
					+ "</td>";
			str1 += "<td name='t5' class='tab_title tabel_hei'>" + obj.CCCC
					+ "</td>";
			str1 += "<td name='t6' class='tab_title tabel_hei'>" + obj.TL
					+ "</td>";
			str1 += "<td name='t7' class='tab_title tabel_hei'>" + obj.TY
					+ "</td>";
			str1 += "<td name='t8' class='tab_title tabel_hei'>" + obj.DYM
					+ "</td>";
			str1 += "<td name='t9' class='tab_title tabel_hei'>" + obj.YJYM
					+ "</td>";
			str1 += "<td name='t10' class='tab_title tabel_hei'>" + obj.YJYM
					+ "</td>";
			str1 += "<td name='t11' class='tab_title tabel_hei'>" + obj.DPWF
					+ "</td>";
			str1 += "<td name='t12' class='tab_title tabel_hei'>" + obj.MFJK
					+ "</td>";
			str1 += "<td name='t13' class='tab_title tabel_hei'>" + obj.BX
					+ "</td>";
			str1 += "<td name='t14' class='tab_title tabel_hei'>" + obj.QQ
					+ "</td>";
			str1 += "<td name='t15' class='tab_title tabel_hei'>" + obj.QL
					+ "</td>";
			str1 += "<td name='t16' class='tab_title tabel_hei'>" + obj.CL
					+ "</td>";
			str1 += "<td name='t17' class='tab_title tabel_hei'>" + obj.PH
					+ "</td>";
			str1 += "<td name='t18' class='tab_title tabel_hei'>" + obj.RQYQ
					+ "</td>";
			str1 += "<td name='t19' class='tab_title tabel_hei'>" + obj.BAK
					+ "</td>";
			str1 += "</tr>";
		}

	}
	return str1;
}

// 基础查询 重置按钮
function clearText() {

	var check = document.getElementsByName("tiaojian");
	// alert(check);
	for ( var i = 0; i < check.length; i++) {
		check[i].value = "";
	}
}
function clearText1() {

	var check = document.getElementsByName("tiaojian1");
	// alert(check);
	for ( var i = 0; i < check.length; i++) {
		check[i].value = "";
	}
}
// 基础查询 根据所选table值生成筛选条件
function col() {
	// alert("12556");
	var x = document.getElementById('s1')
	var table = x.options[x.selectedIndex].value;
	var text = x.options[x.selectedIndex].text;
	if (text == "请选择") {
		table = "cjsctjtemp";
	}
	var str = "";
	if (table == "cjkj") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
		str += "<p style='float:left'>所属井组：<input type='text' name='tiaojian2' /></p>";
		str += "<p style='float:left'>所属区块：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjjbxx") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjmcxx") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
		str += "<p style='float:left'>煤层岩性编码：<input type='text' name='tiaojian2' /></p>";
		str += "<p style='float:left'>层位：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjsjxx") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
		str += "<p style='float:left'>煤层编号：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjzfxx") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjscjt") {
		str += "<p style='float:left'>投产日期：<input type='text' name='tiaojian2' /></p>";
		str += "<p style='float:left'>见气时间：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjscrsctemp") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjsctjtemp") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjgbyxpz") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjgblxpz") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjgbxx") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "mcyxpz") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjbbtjtrue") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	} else if (table == "cjbbrsctrue") {
		str += "<p style='float:left'>井名：<input type='text' name='tiaojian2' /></p>";
	}
	$("#condition2").html(str);
}
// 基础查询 提交按钮
function gsubmit() {
	// alert("hhhh");
	var check = document.getElementsByName("tiaojian2");
	// alert(check);
	var arr = new Array();
	for ( var i = 0; i < check.length; i++) {
		if (check[i].value == "") {
			arr[i] = " ";
		} else {
			arr[i] = check[i].value;
		}
		// alert(check[i].value);
	}
	var x = document.getElementById('s1')
	var table = x.options[x.selectedIndex].value;
	var text = x.options[x.selectedIndex].text;
	if (text == "请选择") {
		table = "cjsctjtemp";
		text = "实测统计表";
	}
	// alert(table);
	$.ajax({
		type : 'post',
		url : 'basic/adQuery',
		data : 'tiaojian2=' + arr + '&table=' + table,
		dataType : 'json'
	}).done(function(data) {
		if (data == "") {
			alert("没有符合条件的记录，请重新输入！");
			return;
		}
		// alert("123");
		var str = protable(table, data, text);
		$('#table1').html(str);
		$("#loginmodal1").css("display", "none");
		$("#lean_overlay").css("display", "none");
		// alert("fall");
	});

}
// 高级查询
function advance() {
	var str= new Array();
	for ( var i = 1; i<=4; i++) {
		if ($("#au_"+i).is(":visible")) {
			//alert($("#s_"+i).val());
			///$("#s_"+i).val();
			//alert($("#sfield_"+i).val());
			//alert($("#operator_"+i).val());
			//alert($("#text_"+i).val());
			str[i-1]=$("#s_"+i).val()+","+$("#sfield_"+i).val()+","+$("#operator_"+i).val()+","+$("#text_"+i).val();
			
		}
	}
	$.ajax({
		type : 'post',
		url : 'basic/advance1',
		data : 'para=' + str,
		dataType : 'json'
	}).done(function(data) {
		if (data == "") {
			alert("没有符合条件的记录,请重新输入");
			return false;
		}

		var str1 = protable(table, data, text);
		alert(str1);
		$('#table1').html(str1);
		$("#loginmodal2").css("display", "none");
		$("#lean_overlay").css("display", "none");
	});
}
/*
 * $("[name='record1']").each(function() { $(this).click(function() { if
 * ($(this).prop("checked")==true) { var check =
 * document.getElementsByName("record"); for ( var i = 0; i < check.length; i++) {
 * check[i].checked = true; } } else { var check =
 * document.getElementsByName("record"); for ( var i = 0; i < check.length; i++) {
 * check[i].checked = false; } } }); });
 */

function quanxuan() {
	if ($("[name='record1']").prop("checked") == true) {
		var check = document.getElementsByName("record");
		for ( var i = 0; i < check.length; i++) {
			check[i].checked = true;
		}
	} else {
		var check = document.getElementsByName("record");
		for ( var i = 0; i < check.length; i++) {
			check[i].checked = false;
		}
	}
}
// 高级查询点击事件
function tiaojian(x){
	var table=$("#"+x).val();
	var str = "";
	if (table == "cjkj") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='wellgroupcode'>井组</option>";
		str += "<option value='blockcode'>气田</option>";
	} else if (table == "cjjbxx") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='longitude'>经度</option>";
		str += "<option value='latitude'>纬度</option>";
		str += "<option value='elevation'>标高</option>";
		str += "<option value='depth'>埋深</option>";
		str += "<option value='totalthickness'>总厚度</option>";
		str += "<option value='netthickness'>净厚度</option>";
		str += "<option value='tonsteinthickness'>夹矸厚度</option>";
		str += "<option value='tonsteinnum'>夹矸层数</option>";
		str += "<option value='roofthickness'>顶板厚度</option>";
		str += "<option value='floorthinkness'>底板厚度</option>";
		str += "<option value='stratumpressure'>储层压力</option>";
		str += "<option value='pressuregradient'>压力梯度</option>";
	} else if (table == "cjmcxx") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='Lithologycode'>煤层岩性编码</option>";
		str += "<option value='layered'>分层号</option>";
		str += "<option value='longitude'>靶点X坐标</option>";
		str += "<option value='latitude'>靶点Y坐标</option>";
		str += "<option value='TELD'>顶海拔深</option>";
		str += "<option value='TS'>顶测深</option>";
		str += "<option value='ES'>底测深</option>";
		str += "<option value='DOT'>视厚</option>";
		str += "<option value='TDD'>顶垂深</option>";
		str += "<option value='BVD'>底垂深</option>";
		str += "<option value='TVT'>垂厚</option>";
		str += "<option value='CAL'>井径</option>";
		str += "<option value='SP'>自然电位</option>";
		str += "<option value='GR'>自然伽马</option>";
		str += "<option value='RD'>深侧向电阻</option>";
		str += "<option value='RS'>浅侧向电阻</option>";
		str += "<option value='RXO'>微球形聚焦</option>";
		str += "<option value='CNL'>中子</option>";
		str += "<option value='AC'>声波时差</option>";
		str += "<option value='DEN'>密度</option>";

	} else if (table == "cjsjxx") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='NCS'>煤层编号</option>";
		str += "<option value='interval'>测试井段</option>";
		str += "<option value='pressure'>储层压力</option>";
		str += "<option value='PCPG'>压力梯度</option>";
		str += "<option value='temperature'>储层温度</option>";
		str += "<option value='penetrance'>渗透率</option>";
	} else if (table == "cjdwxf") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='NCS'>煤层编号</option>";
		str += "<option value='ACS'>样品含气量</option>";
		str += "<option value='pressure'>储层压力</option>";
		str += "<option value='TGC'>理论含气量</option>";
		str += "<option value='Volume'>兰氏体积</option>";
		str += "<option value='pressurelan'>兰氏压力</option>";
		str += "<option value='saturability'>含气饱和度</option>";
		str += "<option value='CDP'>临界解吸压力</option>";
		str += "<option value='ADP'>实际解吸压力</option>";
	} else if (table == "cjzfxx") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='ASH'>灰分</option>";
		str += "<option value='Vitrinite'>镜质组分</option>";
		str += "<option value='Inertinite'>惰质组分</option>";
		str += "<option value='Exinite'>壳质组分</option>";
		str += "<option value='MIR'>镜惰比</option>";
		str += "<option value='VR'>镜质体反射率</option>";
	} else if (table == "cjscjt") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='CW'>生产层位</option>";
		str += "<option value='TCRQ'>投产日期</option>";
		str += "<option value='JQRQ'>见气日期</option>";
		str += "<option value='JQZQ'>见气周期</option>";
		str += "<option value='JQQLCY'>见气前累产液</option>";
		str += "<option value='JQQFPY'>见气前返排率</option>";
		str += "<option value='QCYL'>起抽压力</option>";
		str += "<option value='JXYL'>解吸压力</option>";
		str += "<option value='QCYL'>起抽压力</option>";
		str += "<option value='ZYL'>总液量</option>";
		str += "<option value='ZSL'>总砂量</option>";
		str += "<option value='PLYL'>破裂压力</option>";
		str += "<option value='TBYL'>停泵压力</option>";
	} else if (table == "cjscrsctemp") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='SCRQ'>生产日期</option>";
		str += "<option value='SCSJ'>生产时间</option>";
		str += "<option value='BJBS'>泵径/泵深</option>";
		str += "<option value='CCCC'>冲次/冲程</option>";
		str += "<option value='TL'>电流</option>";
		str += "<option value='TY'>套压</option>";
		str += "<option value='DYM'>动液面</option>";
		str += "<option value='YJYM'>日降液面</option>";
		str += "<option value='PWF'>井底流压</option>";
		str += "<option value='DPWF'>日降井底流压</option>";
		str += "<option value='MFJK'>煤粉情况</option>";
		str += "<option value='BX'>泵效</option>";
		str += "<option value='QQ'>日产气</option>";
		str += "<option value='QL'>日产液</option>";
		str += "<option value='CL'>氯根</option>";
		str += "<option value='PH'>PH值</option>";
		str += "<option value='RQYQ'>燃气机用气</option>";
	} else if (table == "cjsctjtemp") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='SCRQ'>生产日期</option>";
		str += "<option value='YLCQ'>月累产气</option>";
		str += "<option value='LLCQ'>年累产气</option>";
		str += "<option value='LJCQ'>累产气量</option>";
		str += "<option value='YLCY'>月累产液</option>";
		str += "<option value='LLCY'>年累产液</option>";
		str += "<option value='LJCY'>累产液量</option>";

	} else if (table == "cjgbyxpz") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='Lithologycode'>隔板岩性编码</option>";
		str += "<option value='Lithologyname'>隔板岩性名称</option>";
	} else if (table == "cjgblxpz") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='Lithologycode'>隔板类型编码</option>";
		str += "<option value='Lithologyname'>隔板类型名称</option>";
	} else if (table == "cjgbxx") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='Lithologycode'>隔板类型编码</option>";
		str += "<option value='Lithologycode'>隔板岩性编码</option>";
		str += "<option value='layered'>分层号</option>";
		str += "<option value='longitude'>靶点X坐标</option>";
		str += "<option value='latitude'>靶点Y坐标</option>";
		str += "<option value='TELD'>顶海拔深</option>";
		str += "<option value='TS'>隔板顶测深</option>";
		str += "<option value='ES'>隔板底测深</option>";
		str += "<option value='DOT'>隔板视厚</option>";
		str += "<option value='TDD'>隔板顶垂深</option>";
		str += "<option value='BVD'>隔板底垂深</option>";
		str += "<option value='TVT'>隔板垂厚</option>";
		str += "<option value='CAL'>隔板井径</option>";
		str += "<option value='SP'>自然电位</option>";
		str += "<option value='GR'>自然伽马</option>";
		str += "<option value='RD'>深侧向电阻</option>";
		str += "<option value='RS'>浅侧向电阻</option>";
		str += "<option value='RXO'>微球形聚焦</option>";
		str += "<option value='CNL'>中子</option>";
		str += "<option value='AC'>声波时差</option>";
		str += "<option value='DEN'>密度</option>";
	} else if (table == "mcyxpz") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='Lithologycode'>煤层岩性编码</option>";
		str += "<option value='Lithologyname'>煤层岩性名称</option>";
	} else if (table == "cjbbtjtrue") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='SCRQ'>生产日期</option>";
		str += "<option value='YLCQ'>月累产气</option>";
		str += "<option value='LLCQ'>年累产气</option>";
		str += "<option value='LJCQ'>累产气量</option>";
		str += "<option value='YLCY'>月累产液</option>";
		str += "<option value='LLCY'>年累产液</option>";
		str += "<option value='LJCY'>累产液量</option>";
	} else if (table == "cjbbrsctrue") {
		str += "<option value='请选择查询内容'>请选择查询内容</option>";
		str += "<option value='wellname'>井名</option>";
		str += "<option value='SCRQ'>生产日期</option>";
		str += "<option value='SCSJ'>生产时间</option>";
		str += "<option value='BJBS'>泵径/泵深</option>";
		str += "<option value='CCCC'>冲次/冲程</option>";
		str += "<option value='TL'>电流</option>";
		str += "<option value='TY'>套压</option>";
		str += "<option value='DYM'>动液面</option>";
		str += "<option value='YJYM'>日降液面</option>";
		str += "<option value='PWF'>井底流压</option>";
		str += "<option value='DPWF'>日降井底流压</option>";
		str += "<option value='MFJK'>煤粉情况</option>";
		str += "<option value='BX'>泵效</option>";
		str += "<option value='QQ'>日产气</option>";
		str += "<option value='QL'>日产液</option>";
		str += "<option value='CL'>氯根</option>";
		str += "<option value='PH'>PH值</option>";
		str += "<option value='RQYQ'>燃气机用气</option>";
	}
	return str;
}
function adtiaojian() {
   
	for ( var i = 1; i <= 4; i++) {
	  var x = 's_'+i;
	  var str=tiaojian(x);
		$("#sfield_"+i).html(str);
	}
}
function adtiaojian1(table,col){
	//alert(table);
	var str=tiaojian(table);
	$("#"+col).html(str);
}
// 高级查询增减按钮
function deleteRow() {
	if ($("#au_4").is(":visible")){
		$("#au_4").hide();
		return true;
	}
	if ($("#au_4").is(":hidden") && $("#au_3").is(":visible")) {
		$("#au_3").hide();
		return true;
	}
	if ($("#au_4").is(":hidden") && $("#au_3").is(":hidden") && $("#au_2").is(":visible")) {
		$("#au_2").hide();
		return true;
	}
}
function addRow() {
	//alert($("#au_2").is(":hidden") );
	if ($("#au_2").is(":hidden")){
		$("#au_2").show();
		return true;
	}
	if ($("#au_2").is(":visible") && $("#au_3").is(":hidden")) {
		$("#au_3").show();
		return true;
	}
	if ($("#au_2").is(":visible") && $("#au_3").is(":visible") && $("#au_4").is(":hidden")) {
		$("#au_4").show();
		return true;
	}
}


